package com.zzc.service.impl;

import com.zzc.domain.Admin;
import com.zzc.repository.AdminRep;
import com.zzc.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminServiceImp implements AdminService {

    @Autowired
    AdminRep adminRep;

    @Override
    public Admin loginAuthentication(String email) {
        return adminRep.findByEmail(email);
    }

    @Override
    public void pwdRecovery(String pwd, String email) {
        adminRep.updateByEmail(pwd,email);
    }

    @Override
    public List<Admin> getAdmin() {

        List<Admin> admin = adminRep.findAll();
        return admin;
    }


}
